package com.prs.crm.listener;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import org.courser.Util;
import org.courser.struts.BaseAction;


public class SysContextListener implements ServletContextListener {

	public void contextDestroyed(ServletContextEvent arg) {

	}

	public void contextInitialized(ServletContextEvent arg) {
	
		try {
			
			String contextPath = arg.getServletContext().getContextPath();
			if (contextPath.equals("/"))
				contextPath = "";
			String js = "var domain=\"" + contextPath + "\"";
			Util.writeFileContent("/javascript/domain.js", js,
					arg.getServletContext());
		} catch (Exception e) {
		}
	
	}

	
	
}
